export default {
  state: {
    userInfo: {
      avatar: '/image/common/avator.png',
      nikename: '默认名称',
      gender: '性别',
      city: '深圳市南山区',
      id: 1
    },
    isLogin: JSON.parse(localStorage.getItem('isLogin')) || false   // 有登录就拿值，没有就false
  },
  getters: {

  },
  mutations: {
    savaUserInfo(state, payload) {  //payload形参
      state.userInfo = payload
    },
    saveLogin(state,payload){
      state.isLogin = payload
    }
  },
  actions: {
    savaUserInfoAction({commit},payload){
      commit('savaUserInfo',payload)
    },
    saveLoginAction({commit},payload){
      commit('saveLogin',payload)
    },

  }

}